// 代码块 importM
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: const Text("Flutter app"),
        ),
        body: MyHomePage(),
      ),
    );
  }
}

class MyHomePage extends StatelessWidget {
  List<String> list = [];
  MyHomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
        height: 400,
        width: 300,
        color: Colors.red,
        child: Stack( 
          children: [
            Positioned(
              left: 0, // 相对于外部容器进行定位，如果没有外部容器就相对于整个屏幕
              bottom: 0,
              child: Container(
                height: 100,
                width: 100,
                color: Colors.yellow,
              ),
            ),
            const Positioned(
              right: 0,
              top: 0,
              child: Text("你好 Flutter"),
            ),
          ],
        ));
  }
}
